﻿/**********************************************************************
 * @file   FITKRadiossDataCaseAdaptor.h
 * @brief  Radioss数据HDF5适配器
 * @author guqingtao (15598887859@163.com)
 * @date   2025-09-28
 *********************************************************************/
#ifndef FITKRadiossDataCaseAdaptor_H
#define FITKRadiossDataCaseAdaptor_H

#include "FITKRadiossDataHDF5Adaptor.h"
#include "FITKRadiossDataIOHDF5API.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"

namespace H5
{
    class Group;
}
namespace Radioss
{
    class FITKRadiossCase;
}
namespace Interface
{
    /**
     * @brief  RadiossData适配器
     * @author guqingtao (15598887859@163.com)
     * @date   2025-09-29
     */
    class FITKRadiossDataIOHDF5API FITKRadiossDataCaseAdaptor : public FITKRadiossDataHDF5Adaptor
    {
    public:
        explicit FITKRadiossDataCaseAdaptor() = default;
        ~FITKRadiossDataCaseAdaptor() = default;

        virtual bool adaptR() override;
        virtual bool adaptW() override;
    private:
        bool readPart(H5::Group& g);
        bool writePart(H5::Group& g);

        bool readNode(H5::Group& g);
        bool writeNode(H5::Group& g);

        bool readNodeSet(H5::Group& g);
        bool writeNodeSet(H5::Group& g);

        bool readSubSet(H5::Group& g);
        bool writeSubSet(H5::Group& g);

        bool readSurface(H5::Group& g);
        bool writeSurface(H5::Group& g);

        bool readMaterials(H5::Group& g);
        bool writeMaterials(H5::Group& g);

        bool readProperty(H5::Group& g);
        bool writeProperty(H5::Group& g);

        bool readInteraction(H5::Group& g);
        bool writeInteraction(H5::Group& g);

        bool readCurve(H5::Group& g);
        bool writeCurve(H5::Group& g);

        bool readInitialField(H5::Group& g);
        bool writeInitialField(H5::Group& g);

        bool readGravity(H5::Group& g);
        bool writeGravity(H5::Group& g);

        bool readRigidWall(H5::Group& g);
        bool writeRigidWall(H5::Group& g);

        bool readSolverSetting(H5::Group& g);
        bool writeSolverSetting(H5::Group& g);

        bool readResultRequest(H5::Group& g);
        bool writeResultRequest(H5::Group& g);
    private:
        /**
         * @brief  算例数据
         * @author guqingtao (15598887859@163.com)
         * @date   2025-09-28
         */
        Radioss::FITKRadiossCase* _caseData{};

    };
    Register2FITKIOAdaptorFactory(HDF5, Radioss::FITKRadiossCase, FITKRadiossDataCaseAdaptor)
}

#endif 

